home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-18 | 1.5 KB | 50 lines | [TEXT/MPS ] |
- // Class definitions.
-
- // Our document class. Only displays some text in a window
- //
- class TMacTutorDocument : public TDocument {
-
- private:
- short fItemSelected;
- // string corresponding to menu item selected
- StringPtr fDisplayString;
-
- void DrawWindow(void);
-
- public:
- TMacTutorDocument(short resID, StringPtr s);
- ~TMacTutorDocument(void);
- // routine to access private variables
- void SetDisplayString (StringPtr s) {fDisplayString = s;}
- short GetItemSelected(void) {return fItemSelected;}
- void SetItemSelected(short item) {fItemSelected = item;}
-
- // methods from TDocument we override
- void DoUpdate(void);
- };
-
- // TMacTutorApp is our application class. It is a subclass of TApplication,
- // so it only needs to specify its behaviour in areas where it is different
- // from the default.
- class TMacTutorApp : public TApplication {
- public:
- TMacTutorApp(void); // Our constructor
-
- private:
- // routines from TApplication we are overriding
- long HeapNeeded(void);
- unsigned long SleepVal(void);
- void AdjustMenus(void);
- void DoMenuCommand(short menuID, short menuItem);
-
- // routines for our own devious purposes
- void DoNew(void);
- void Terminate(void);
- };
-
- // kMaxOpenDocuments is used to determine whether a new document can be opened
- // or created. We keep track of the number of open documents, and disable the
- // menu items that create a new document when the maximum is reached. If the
- // number of documents falls below the maximum, the items are enabled again. */
- const short kMaxOpenDocuments = 1;
-